package edu.pw.treegrid.server.web.converters;

import xalan.smartgwt.record.BeanToRecordConverter;
import xalan.smartgwt.record.Record;
import edu.pw.treegrid.server.model.SecondDimensionObject;

public class SecondDimensionObjectConverter implements BeanToRecordConverter<SecondDimensionObject> {

	public static final String ID_FIELD = "id";
	public static final String PARENT_ID_FIELD = "parentId";
	public static final String LABEL_FIELD = "label";
	public static final String LEVEL_FIELD = "level";
	public static final String ORDER_FIELD = "order";
	
	
	@Override
	public void convert(Record record, SecondDimensionObject bean) {
		record.addParam(ID_FIELD, bean.getId());
		record.addParam(PARENT_ID_FIELD, bean.getParentId());
		record.addParam(LABEL_FIELD, bean.getLabel());
		record.addParam(LEVEL_FIELD, bean.getLevel());
		record.addParam(ORDER_FIELD, bean.getOrder());
	}

}
